﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MMarketitemList.aspx.cs" Inherits="IHISCETeim.Web.MachineSys.MarketModel.MMarketitemList" %>

<form id="pagerForm" method="post" action="MarketModel/MMarketitemList.aspx">
<input type="hidden" name="ItemName" value="<%=ItemName %>" />
<input type="hidden" name="SupplierName" value="<%=SupplierName %>" />
<input type="hidden" name="ShowListType" value="<%=ShowListType %>" />
<input type="hidden" name="orderField" value="<%=orderField %>" />
<input type="hidden" name="orderDirection" value="<%=orderDirection %>" />
<input type="hidden" name="pageNum" value="1" />
<input type="hidden" name="numPerPage" value="<%=numPerPage %>" />
</form>
<form id="form1" runat="server" method="post" action="MarketModel/MMarketitemList.aspx" onsubmit="return navTabSearch(this);">
<div class="pageHeader">
    <div class="searchBar">
        <table class="searchContent">
            <tr>
                <td>
                    物料名称： 
                </td>
                <td>
                    <input name="ItemName" type="text" value="<%=ItemName %>"   />
                </td>
                <td>
                    供应商： 
                </td>
                <td>
                   <input name="SupplierName" type="text" value="<%=SupplierName %>"  />
                </td>
               <input type="hidden" name="ShowListType" value="<%=ShowListType %>" />
            </tr>
        </table>
        <div class="subBar">
            <ul>
                <li>
                    <div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div>
                </li>
            </ul>
        </div>
    </div>
</div>
<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
          <% if (HasPower(IHISCETeim.Web.Permission.新增))
             {%>
            <li><a class="add" href="MarketModel/MMarketitemAdd.aspx" target="dialog" rel="MMarketitemAdd"  title="新增物料"><span>新增物料</span></a></li>
           <%} %>
            <% if (HasPower(IHISCETeim.Web.Permission.删除))
               {%>
            <li><a class="delete" href="sysAjaxDone.ashx?ajaxmethod=DeleteMMarketitem&MMID={sid_user}" target="ajaxTodo" title="确定要删除吗?"><span>删除</span></a></li>
           <%} %>
           <% if (HasPower(IHISCETeim.Web.Permission.修改))
              {%>
            <li><a class="edit" href="MarketModel/MMarketitemEdit.aspx?MMID={sid_user}" rel="MMarketitemEdit" target="dialog" title="修改" max=false  mask=true  maxable=false  minable=false  resizable=false drawable=true  width="520" height="300" ><span>修改</span></a></li>
          <%} %>

           <% if (HasPower(IHISCETeim.Web.Permission.修改))
              {%>
            <li><a class="edit" href="MarketModel/MMarketitemBuy.aspx?MMID={sid_user}" rel="MMarketitemBuy" target="dialog" title="入库" max=false  mask=true  maxable=false  minable=false  resizable=false drawable=true  width="520" height="300" ><span>入库</span></a></li>
          <%} %>

           <% if (HasPower(IHISCETeim.Web.Permission.修改))
              {%>
            <li><a class="edit" href="MarketModel/MMarketitemSell.aspx?MMID={sid_user}" rel="MMarketitemSell" target="dialog" title="出库" max=false  mask=true  maxable=false  minable=false  resizable=false drawable=true  width="800" height="400" ><span>出库</span></a></li>
          <%} %>

           <% if (HasPower(IHISCETeim.Web.Permission.导出))
                {%>
            <li><a class="icon" href="MarketModel/Execl/ExportMMarketitemList.aspx?orderField=<%=orderField %>&orderDirection=<%=orderDirection %>&ItemName=<%=ItemName %>&SupplierName=<%= Server.UrlEncode( SupplierName) %>" target="_blank" title="确定要导出吗?"><span>导出</span></a></li>
            <%} %>
        </ul>
    </div>
    <asp:repeater id="rpMenu" runat="server">
        <HeaderTemplate>
        <table class="table" width="100%" layouth="138">
        <thead>
            <tr  >
                <%if (ShowListType == 0)
                  { %>
                <th width="50" orderField="DisplayNum" class="asc" >#</th>
                <%} %>
                <%if (ShowListType == 0 || ShowListType == 1 || ShowListType == 2)
                  { %>                
                <th width="130">
                    物料名称
                </th>
                <%} %>
                <%if (ShowListType == 0 || ShowListType == 1 )
                  { %>
                <th  width="120">
                    供应商
                </th>
                <%} %>
                 <%if (ShowListType == 0 || ShowListType == 1)
                   { %>
                <th  width="60" orderField="Price" class="asc">
                    单价
                </th>
                <%} %>
                <%if (ShowListType == 0 || ShowListType ==2)
                  { %>
                <th width="80" orderField="InHold" class="asc">
                    当前库存
                </th>
                <%} %>
                <%if (ShowListType == 0)
                  { %>
                <th width="80" >
                    期初库存
                </th>
                <th width="80">
                    总入库量
                </th>
                <th width="80">
                    总出库量
                </th>
                <%} %>
                <th>
                    &nbsp;
                </th>
            </tr>   
        </thead>
        <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr target="sid_user" rel="<%# Eval("MMID") %>">
                 <%if (ShowListType == 0)
                  { %>
                <td ><%# Eval("DisplayNum")%></td>
                <%} %>
            <%if (ShowListType == 0 || ShowListType == 1 || ShowListType == 2)
                  { %>
				<td><%# Eval("ItemName")%></td>
                  <%} %>
                <%if (ShowListType == 0 || ShowListType == 1 )
                  { %>
				<td><%# Eval("SupplierName")%></td>
                <%} %>
                 <%if (ShowListType == 0 || ShowListType == 1)
                   { %>
                 <td><%# Eval("Price")%></td>
                   <%} %>
                <%if (ShowListType == 0 || ShowListType == 2)
                  { %>
				<td><%# Convert.ToInt32( Eval("InHold"))%></td>
                <%} %>
                <%if (ShowListType == 0)
                  { %>
				<td><%# Convert.ToInt32( Eval("StartStock"))%></td>
                  <%} %>
                <%if (ShowListType == 0)
                  { %>
                <td><%# Convert.ToInt32(  Eval("AllBuyNum"))%></td>
                <td><%# Convert.ToInt32( Eval("AllSellNum"))%></td>
                 <%} %>
                 <td>
                 <a class="edit" href="MarketModel/MMarketitemBuyDetail.aspx?MMID=<%# Eval("MMID") %>" rel="MMarketitemBuyDetail" target="dialog" title="<%# Eval("ItemName")%>入库明细" max=false  mask=true  maxable=false  minable=false  resizable=false drawable=true  width="520" height="300" ><span>入库明细</span></a>
                 &nbsp;|&nbsp;
                 <a class="edit" href="MarketModel/MMarketitemSellDetail.aspx?MMID=<%# Eval("MMID") %>" rel="MMarketitemSellDetail" target="dialog" title="<%# Eval("ItemName")%>出库明细" max=false  mask=true  maxable=false  minable=false  resizable=false drawable=true  width="800" height="300" ><span>出库明细</span></a>
                 </td>
                
			</tr>
        </ItemTemplate>
        <FooterTemplate>
            </tbody>
         </table>
        </FooterTemplate>
    </asp:repeater>
    <div class="panelBar">
        <div class="pages">
            <span>显示</span>
            <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
               <%=SetnumPerPage() %>
            </select>
            <span>条，共<%=TotalCount%>条</span>
        </div>
        <div class="pagination" targettype="navTab" totalcount="<%=TotalCount%>" numperpage="<%=numPerPage %>"
            pagenumshown="10" currentpage="<%=pageNum %>">
        </div>
    </div>
</div>
</form>
